package cn.com.blueInfo.bpm.person.enums;

import cn.com.blueInfo.bpm.common.enums.BaseEnum;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 人员状态
 * @author suxch
 * @since 2025-08-28 22:06:38
 */
@Getter
@AllArgsConstructor
public enum UserBaseUserStatus implements BaseEnum<Integer> {

    /** 人员状态-在职 */
    ON_THE_JOB(1, "在职"),
    /** 人员状态-离职 */
    DIMISSION(2, "离职"),
    /** 人员状态-待入职 */
    PENDING_ENTRY(3, "待入职"),
    /** 人员状态-休假 */
    ON_LEAVE(4, "休假");

    @EnumValue
    private final Integer code;

    @JsonValue
    private final String desc;

    public static UserBaseUserStatus getByCode(Integer code) {
        return BaseEnum.getByCode(UserBaseUserStatus.class, code);
    }

    @JsonCreator
    public static UserBaseUserStatus getByName(String name) {
        return BaseEnum.getByName(name, UserBaseUserStatus.class);
    }

}
